package com.sky.mapper;

import com.sky.dto.GoodsSalesDTO;
import com.sky.entity.OrderDetail;
import com.sky.entity.Orders;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface OrderDetailMapper {

    void insertBach(List<OrderDetail> orderDetails);

    @Select("select * from sky_take_out.order_detail where order_id = #{id}")
    List<OrderDetail> selectByOrderId(Long id);

    List<GoodsSalesDTO> getTop10Sales(LocalDateTime begin, LocalDateTime end);
}
